load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "rafttest",
    srcs = [
        "doc.go",
        "interaction_env.go",
        "interaction_env_handler.go",
        "interaction_env_handler_add_nodes.go",
        "interaction_env_handler_campaign.go",
        "interaction_env_handler_compact.go",
        "interaction_env_handler_deliver_msgs.go",
        "interaction_env_handler_forget_leader.go",
        "interaction_env_handler_log_level.go",
        "interaction_env_handler_process_append_thread.go",
        "interaction_env_handler_process_apply_thread.go",
        "interaction_env_handler_process_ready.go",
        "interaction_env_handler_propose.go",
        "interaction_env_handler_propose_conf_change.go",
        "interaction_env_handler_raft_log.go",
        "interaction_env_handler_raftstate.go",
        "interaction_env_handler_report_unreachable.go",
        "interaction_env_handler_send_snapshot.go",
        "interaction_env_handler_set_randomized_election_timeout.go",
        "interaction_env_handler_stabilize.go",
        "interaction_env_handler_status.go",
        "interaction_env_handler_store_liveness.go",
        "interaction_env_handler_tick.go",
        "interaction_env_handler_transfer_leadership.go",
        "interaction_env_logger.go",
        "network.go",
        "node.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/raft/rafttest",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/raft",
        "//pkg/raft/raftpb",
        "//pkg/raft/raftstoreliveness",
        "//pkg/raft/tracker",
        "//pkg/util/hlc",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)

go_test(
    name = "rafttest_test",
    srcs = [
        "network_test.go",
        "node_bench_test.go",
        "node_test.go",
    ],
    embed = [":rafttest"],
    deps = [
        "//pkg/raft",
        "//pkg/raft/raftpb",
        "//pkg/testutils/skip",
    ],
)
